package demo5;

/**
 * ClassName Test
 * Description TODO
 * Author Yanyan
 * Date 2025/11/13 14:16
 * Version 1.0
 */
public class Test {
    public static void eat(Animal animal) {
        animal.eat();
    }

    public static void  running(IRunnable runnable) {
        runnable.run();
    }

    public static void flying(IFlyable flyable) {
        flyable.fly();
    }

    public static void swimming(ISwimmable swimmable) {
        swimmable.swim();
    }

    public static void main(String[] args) {
        Dog dog = new Dog("大黄",5);
        Bird bird = new Bird("鸟儿尧",4);
        Fish fish = new Fish("鱼儿",1);

        running(dog);
        running(bird);
        System.out.println("==================");
        flying(bird);
        System.out.println("==================");
        swimming(dog);
        swimming(fish);

        System.out.println("===================");

        Robot robot = new Robot();
        running(robot);


    }
}
